const http = require("http");

let is_running = false;
let options = {
    hostname: '127.0.0.1',
    port: 12380,
    path: '/xx/',
    agent: false,
    timeout: 3000,
}
http.get(options, (res) => {
    let { statusCode } = res;

    if (statusCode !== 200) {
        console.log('Request Failed, ' + `Status Code: ${statusCode}`);
        res.resume();
        return;
  }

  res.setEncoding('utf8');
  let rawData = '';
  res.on('data', (chunk) => { rawData += chunk; });
  res.on('end', () => {
      console.log(rawData);
      if (rawData.indexOf("JoinQuant") > 0) {
        is_running = true;
      }
  });
}).on('error', (e) => {
  console.error(`Got error: ${e.message}`);
});

console.log("is_running: ", is_running);
